/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.banconacion.servlet;

import com.banconacion.service.SolicitudAperturaService;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
/**
 *
 * @author igorov
 */
public class CalificarEvaluacionSolicitud extends HttpServlet {

    private static final long serialVersionUID = 2652225997622140246L;

    protected void service(
            HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {
        
        String numeroSolicitud = request.getParameter("txtNumSoli");
        String boton = request.getParameter("boton");
        SolicitudAperturaService aperturaService = new SolicitudAperturaService();
        
        try {
            
            if (boton.compareTo("Aprobar") == 0){ //boton aprobar
                aperturaService.AprobarDesaprobarSolicitud(Integer.valueOf(numeroSolicitud), 1);
            }
            else if (boton.compareTo("Desaprobar") == 0){//boton desaprobar
                aperturaService.AprobarDesaprobarSolicitud(Integer.valueOf(numeroSolicitud), -1);
            }
        } catch (Exception e) {
        }

        request.getRequestDispatcher("/pages/MenuAsesor.jsp").forward(request, response);
    }
    
}
